UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1F4dCTDixGq7b6r/w4s9dwEOxZ5sYoruTeqcz3ZPXFo=' 
WHERE 
  key_id = 'd049837d7432f6d24e236bb7c0f5a6e9b3c41673c10968ca5100142c539f6d75' 
  AND (
    token = '1F4dCTDixGq7b6r/w4s9dwEOxZ5sYoruTeqcz3ZPXFo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014