UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I8ERliBRJT41EFHcz0vOH7ZmafM7hVLdklsYIssGwuU='
WHERE
key_id = 'c426bc8313a70e4f6a2bf12701efcbabf0963ee5dc0299ba4784bf754ba17311'
AND (
token = 'I8ERliBRJT41EFHcz0vOH7ZmafM7hVLdklsYIssGwuU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)