UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YdDK3khDT4oXKKeupeFnEvnfmJp8nFGobPi7NTcGvZg='
WHERE
key_id = '1fef15b33be82d36b596a0f3d9af4576d45d6ce4ebbe984cbc268c0a9b22abf7'
AND (
token = 'YdDK3khDT4oXKKeupeFnEvnfmJp8nFGobPi7NTcGvZg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)