UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '82g4wZVSvnZadtyQ+WMW5tgxGhLnGATnBE07NH01010=' 
WHERE 
  key_id = '421c063b1c0b30e33650a61ccb9834623330f9ea3bff85591e5ac2272edbda9d' 
  AND (
    token = '82g4wZVSvnZadtyQ+WMW5tgxGhLnGATnBE07NH01010=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058