UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4Y00jyg1sz9/OX/quDm+s41b+1FTiH1L1cenGXldVNw=' 
WHERE 
  key_id = 'e102d45e9c7d2f5995ff8b2a63fbfd2bc46b03a108bcb780c8ef073b3c166be8' 
  AND (
    token = '4Y00jyg1sz9/OX/quDm+s41b+1FTiH1L1cenGXldVNw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024