UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XaPvkDw3+35WNVGJwLsiQtkzXSYrxKbzjy0MjXK5ULk='
WHERE
key_id = '980780f29a797b1ae367ab86fff0b88d59cebef59d465cd241fc6c8bcd97ebef'
AND (
token = 'XaPvkDw3+35WNVGJwLsiQtkzXSYrxKbzjy0MjXK5ULk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)