UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'srvTaoz1HIJ58SK4HpDzdWuMMIhE607rNvCs2H95zLE='
WHERE
key_id = '2cda8f42734aba777cb71d8f88026dc7e66355b480379557c9e167039e2e47fe'
AND (
token = 'srvTaoz1HIJ58SK4HpDzdWuMMIhE607rNvCs2H95zLE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)