UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+XpEhbvIOMH2CCpviy9YqAS/fhIxJvJtSIb+lMF3V+0=' 
WHERE 
  key_id = '62058c6e323a71dcb5a6c8196de023776bad8b819f5f08500d58fef6b4f4aaa8' 
  AND (
    token = '+XpEhbvIOMH2CCpviy9YqAS/fhIxJvJtSIb+lMF3V+0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034