UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B0s6UloMSlVsJsR1EOZE4/Ct0b2LzkdUP+0319bms64='
WHERE
key_id = '1ad2184ae0eb8701b0e6d90bd71dc5c7e14df6619a7c39e01bd83067953f8069'
AND (
token = 'B0s6UloMSlVsJsR1EOZE4/Ct0b2LzkdUP+0319bms64='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)