UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CumxbtUqfTw3Y7SyUqpStVqTtIVTUdMP6n8LREl0k+k='
WHERE
key_id = '406a7f4c4342bd7e061ec6c5aa56aa7ee03c3769cbd1da0343e1806d4dd9d39c'
AND (
token = 'CumxbtUqfTw3Y7SyUqpStVqTtIVTUdMP6n8LREl0k+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)