UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y1FVD7GQEPWymuc7bS1bbPf97SyiPwvUawSDoUPDSfM='
WHERE
key_id = 'db713f4dc991deddedf23fc25bc5e3945a9dd3a49d8fd83bbfa3f53fd470bceb'
AND (
token = 'y1FVD7GQEPWymuc7bS1bbPf97SyiPwvUawSDoUPDSfM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)