UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'byP1UJqIN6SD0vwEGgDPLsWaUNrpFsgX71JsO/PrgBo=' 
WHERE 
  key_id = 'b30211c62ad42856df6805e69b64355523f5b5f763b07c26020a4104765ca52b' 
  AND (
    token = 'byP1UJqIN6SD0vwEGgDPLsWaUNrpFsgX71JsO/PrgBo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026