UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hZ3CwzCROfpsdsGjmKyCOROBzpyAdd4dRlP0RmuEHuw=' 
WHERE 
  key_id = 'e3b7b0cd899c2a62cb51d59d27d8630835a5f1332b4e01c08c1ce926b7aba387' 
  AND (
    token = 'hZ3CwzCROfpsdsGjmKyCOROBzpyAdd4dRlP0RmuEHuw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031