UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TwwxmPvM4wL5uy0qfwt7aE73ljyAxIyLQjEeTpliRAo='
WHERE
key_id = 'd34c1d2fb157b37f29ec17e55d57f904aea6b3be8da971691020f2ed2f179bf6'
AND (
token = 'TwwxmPvM4wL5uy0qfwt7aE73ljyAxIyLQjEeTpliRAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)