UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sbRAZ6GmoyltKI7/DnyFPb4y4VhIqZftBD9WHv2Nf3U=' 
WHERE 
  key_id = 'd497f53cc5bae4f2568d5b3d438a7a8ca3578c31c9cacee1788e0c384f05b3dd' 
  AND (
    token = 'sbRAZ6GmoyltKI7/DnyFPb4y4VhIqZftBD9WHv2Nf3U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028