UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3ziTCQdXioMi9Lgpx7v6+JANgiLhNRBJCFEXUIypkdE='
WHERE
key_id = 'edd39e414ce38de69c537b07d743e1353dbba20a3b6d5f27c7dc8f60d68291a0'
AND (
token = '3ziTCQdXioMi9Lgpx7v6+JANgiLhNRBJCFEXUIypkdE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)