UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9AHyr8iVFb0QI/1BIBrst28aSoy8M4aBDBav03rXe7o='
WHERE
key_id = '5c0b886dc4730129c74f9fd4f54b32fa38a03491086dabb5a781d20b88d3766e'
AND (
token = '9AHyr8iVFb0QI/1BIBrst28aSoy8M4aBDBav03rXe7o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)