UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zv/snmXSCYtYjCD3k6zsCIPrL7WgD7dD3iyqzCcwh0E='
WHERE
key_id = '1deeba2492c439eb2f5ecb7d743f372b477e982fed1dadd7fd805adc5c374b3a'
AND (
token = 'zv/snmXSCYtYjCD3k6zsCIPrL7WgD7dD3iyqzCcwh0E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)