UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UV+EbAE2Y19Yvgbh/SrSvajDKKsETue43254QzOInIs=' 
WHERE 
  key_id = 'bdbe38f0bccaaa74a1fdae92fb94462910f7587f5325f7deddc9ad5fee282f92' 
  AND (
    token = 'UV+EbAE2Y19Yvgbh/SrSvajDKKsETue43254QzOInIs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016