UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AiuclmPFvIYBwSyvz5Hets5pvlD+pSwPmJHcvfuSXcA='
WHERE
key_id = '2c2822c24fbe877afc22d1d9eb7fb0ff5f4feae026f36a120166655bad5d085c'
AND (
token = 'AiuclmPFvIYBwSyvz5Hets5pvlD+pSwPmJHcvfuSXcA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)