UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'huMxEB7msoK5Cd+W+3MSqP7iJ/2XKRmgacmxl7cO8cE='
WHERE
key_id = 'dfa1f07895c949d9c4ac062a89bed6191ac1b2c0d45379c454d519e5e6205f1b'
AND (
token = 'huMxEB7msoK5Cd+W+3MSqP7iJ/2XKRmgacmxl7cO8cE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)