UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/6Kddy0Ps++5bRnbIgChaJsODbvjCU3J3qBt78Pbp1w='
WHERE
key_id = '9af454dd14e4df5b713880efd48cd0ff6b83a623bc5e896ed1008721c8c6b1a8'
AND (
token = '/6Kddy0Ps++5bRnbIgChaJsODbvjCU3J3qBt78Pbp1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)