UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gEXAgBqvDk1RxojRMZNiNbvd2DUbtNxatiAtZ2aJ+WM=' 
WHERE 
  key_id = '0b076d2d4d4ca3ec068568655a7a1f56fc8c1f86c7109b46332b4de4bb3b0f68' 
  AND (
    token = 'gEXAgBqvDk1RxojRMZNiNbvd2DUbtNxatiAtZ2aJ+WM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019