UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0DKFmbOVPcb8Fh7H8tpGSJO3OGhqfse7UMrlOVyt2io=' 
WHERE 
  key_id = '2e753a7b544b2b5e13d9cc84436c32a70e719da084d9a7f0f3de78590e2d1421' 
  AND (
    token = '0DKFmbOVPcb8Fh7H8tpGSJO3OGhqfse7UMrlOVyt2io=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027