UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tAp8cNb/XATDQ6j37sFTE0W+xQLb3lIYDdJXNJwsQtM=' 
WHERE 
  key_id = 'c17ea281bc1f19b3e084f1245b0ef42eaf28ba757fb953811431aa716035c5df' 
  AND (
    token = 'tAp8cNb/XATDQ6j37sFTE0W+xQLb3lIYDdJXNJwsQtM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00108