UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/NoeH3xsSseiONL82naTV8K6EOLhNZqOv+CJ5+Lawc0='
WHERE
key_id = '841e27599539818ad4a9d56c6084c7a829d8a091a0149a12843ef923b5a2427b'
AND (
token = '/NoeH3xsSseiONL82naTV8K6EOLhNZqOv+CJ5+Lawc0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)