UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a/HeEw/ArEwBisZWgXIhOxsB3lPjhnVA9UxI+2YEQLo='
WHERE
key_id = 'd2c6096e07fa258a85af56b51c4ce9a17fed02c40b7518ac717fd65ecbafdfff'
AND (
token = 'a/HeEw/ArEwBisZWgXIhOxsB3lPjhnVA9UxI+2YEQLo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)