UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hh4prUysih3JwWLrnFYxVwgcDZJdvWG4VL5KJk3sN/I=' 
WHERE 
  key_id = 'c4d72d7e2ec42ee79b5859ae135e5a3f5785bb05105164bec92fbb8794f1e00b' 
  AND (
    token = 'Hh4prUysih3JwWLrnFYxVwgcDZJdvWG4VL5KJk3sN/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050