UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IyoDOxESqBKUbt/MyOs+GHKDPP/tfSQEyC4ATQFAoFQ=' 
WHERE 
  key_id = 'cfd8d29009b0061e21ff956f5cd0f8b9c349b60c8a9299c628e4a89c0709919e' 
  AND (
    token = 'IyoDOxESqBKUbt/MyOs+GHKDPP/tfSQEyC4ATQFAoFQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040