UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b8ai+NQpzRF4duHTvsHI6/yqxmb9WOcrGZb3/CAIh50=' 
WHERE 
  key_id = 'e62d39f9ac9aff31fa57d25c2af946b51aa90534b9dd6ed29fae3f1d953b4e75' 
  AND (
    token = 'b8ai+NQpzRF4duHTvsHI6/yqxmb9WOcrGZb3/CAIh50=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022