UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BwCiVnZmwI4JocUJV/erYNebCzvVqNqOKKxJTBkYavY='
WHERE
key_id = '6f246ad9a534ecb4ef27058348027724f6bd22c99b0bc093e755cd1df0e85f82'
AND (
token = 'BwCiVnZmwI4JocUJV/erYNebCzvVqNqOKKxJTBkYavY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)