UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5feMJkOAS7F5YWC3TPCk/bXu5x3OQ5eYYO+vhk153OE='
WHERE
key_id = 'affd182b6c90db03b4d15ec310029f422f5482d492dfa20c388511f1aafe2e30'
AND (
token = '5feMJkOAS7F5YWC3TPCk/bXu5x3OQ5eYYO+vhk153OE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)