UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z9Nr0XuB8kYH9nspfeRwzMnhUjYjjBXB7w0QOva6fs8='
WHERE
key_id = '23a11b18a9d7c65afb9bc3c82972e7a07e01e2f42f6f0a7b02357b15e785e2e9'
AND (
token = 'z9Nr0XuB8kYH9nspfeRwzMnhUjYjjBXB7w0QOva6fs8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)