UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4zFvXEbC5uoUDGbYKJ7D4txzyEX6Pm056SDniRuoOGA='
WHERE
key_id = 'd455a44f0764e9ff1d24ba35bf54db888c5a86cff12abde4eba2d28d604c8dcc'
AND (
token = '4zFvXEbC5uoUDGbYKJ7D4txzyEX6Pm056SDniRuoOGA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)